/*Source

Problem Id:2611  User Id:Latex 
Memory:24K  Time:0MS
Language:C++  Result:Accepted

Source 
*/
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <stdlib.h>
using namespace std;


int ans[40];

char s[40];

int len;
int ii, jj;

int getmin(int a, int minsite)
{
	int i, minv;

	minv = ans[minsite];
	for (i=a+1; i<=len; ++i)
	{
		switch (ans[i])
		{
		case 5:
			if (ans[a] < 2 && 2 < minv)
			{
				minv = 2;
				minsite = i;
				ans[i] = 2;
			}
			if (ans[a] < 5 && 5 < minv)
			{
				minv = 5;
				minsite = i;
				ans[i] = 5;
			}

			break;
		case 9:
			if (ans[a] < 6 && 6 < minv)
			{
				minv = 6;
				minsite = i;
				ans[i] = 6;
			}
			if (ans[a] < 9 && 9 < minv)
			{
				minv = 9;
				minsite = i;
				ans[i] = 9;
			}
			break;
		case 0:
		case 1:
		case 2:
		case 3:	
		case 4:		
		case 6:
		case 7:
		case 8:
			if (ans[a] < ans[i] && ans[i] < minv)
			{
				minv = ans[i];
				minsite = i;
			}
			
		}
	}
	return minsite;
}

void change(int head, int tail)
{
		if (head <= tail)
		{
			for (ii=head; ii<=tail; ++ii)
			{
				if (ans[ii] == 5) ans[ii] = 2;
				else if (ans[ii] == 9) ans[ii] = 6;
			}	
			for (ii=head; ii<tail; ++ii)
				for (jj=ii+1; jj<=tail; ++jj)
					if (ans[ii] > ans[jj])
						swap(ans[ii], ans[jj]);
		}
}



int main()
{
	int i, j, k;


	while (scanf("%s", s)!=EOF)
	{
		if (s[0] == '.') break;
		len = strlen(s);
		memset(ans, 0, sizeof(ans));
		for (i=0; i<=len-3; ++i)
			ans[i] = s[i] - '0';
		ans[len-2] = s[len-1] - '0';
		len -= 2; 
		/*/ check 
		for (i=0; i<=len; ++i)
			printf("%d", shu[i]);
		printf("\n\n");
		// check*/

		bool out;

		out = false;
		for (k=len; k>=0; --k)
		{
			switch (ans[k])
			{
			case 2:
				for (i=k+1; i<=len; ++i)
					if (ans[i] > ans[k])
						break;			
				if (i<=len)
				{
					j=getmin(k, i);
					if (ans[j] > 5) 
					{
						j = k;
						ans[j] = 5;
					}

					swap(ans[k], ans[j]);
					
					change(k+1, len); // change and sort
					out = true;
				}
				else
				{
					ans[k] = 5;
					change(k+1, len);
					out = true;
				}
				break;
			case 6:
				for (i=k+1; i<=len; ++i)
					if (ans[i] > ans[k])
						break;			
				if (i<=len)
				{
					j=getmin(k, i);
			//		if (ans[j] > 9) j = k;

					swap(ans[k], ans[j]);
					
					change(k+1, len); // change and sort
					out = true;
				}
				else
				{
					ans[k] = 9;
					change(k+1, len);
					out = true;
				}
				
				break;
			case 0:
			case 1:
			case 3:
			case 4:
			case 5:		
			case 7:
			case 8:
			case 9:
				for (i=k+1; i<=len; ++i)
					if (ans[i] > ans[k])
						break;
				if (i<=len)
				{
					j=getmin(k, i);

					swap(ans[k], ans[j]);
					
					change(k+1, len); // change and sort
					out = true;
				}
				break;
			} // end of switch

			if (out) 
			{
				break;
			}
			
		}

		if (!out) printf("The price cannot be raised.\n");
		else 
		{
			for (i=0; i<len; ++i)
				printf("%d", ans[i]);
			printf(".%d\n", ans[len]);
		}



	}

	return 0;
}


